var ws,order_num,logistics_company;
var app = angular.module('app',[]);
app.controller('my_controller',function($scope,$http){
	$scope.intview = function(){
		console.log(logistics_company +"#####"+ order_num);
		plus.nativeUI.showWaiting('加载中...');
		$http({
			method:'post',
			url:apiRoot,
			data:{
				action:'exp.query',
				com: logistics_company,
				no: order_num			
			}
		}).then(function success(result){
			$scope.res = result.data.data;  
			plus.nativeUI.closeWaiting();
			console.log(JSON.stringify($scope.res));
		},function errorFunction(e){
			console.log(JSON.stringify(e));
			plus.nativeUI.closeWaiting();
		})
	}
	
})

document.addEventListener('plusready',function(){
	ws = plus.webview.currentWebview();
	order_num = ws.order_num;
	logistics_company = ws.company_name;
	appElement = document.querySelector('[ng-controller=my_controller]');
	$scope = angular.element(appElement).scope();
	$scope.intview();
	$scope.$apply();
})

